package demo2;

/**
 * @ClassDescription:
 * @JdkVersion: 1.8
 * @Author: 李白
 * @Created: 2024/4/26 20:32
 */
public class Test {
}
class Animal{
    public String name;
    public Animal(String name){
        this.name = name;
    }
}
interface IRun{
    public abstract void run();
}
interface ISwim{
    public abstract void swim();
}
interface IFly{
    public abstract void fly();
}
class Frog extends Animal implements IRun,ISwim{

    @Override
    public void run() {
        System.out.println(this.name+"正在呱呱跑");
    }
    public Frog(String name){
        super(name);
    }
    @Override
    public void swim() {
        System.out.println(this.name+"正在呱呱游泳");
    }
}
class Dog extends Animal implements IRun{
    public void run(){
        System.out.println(this.name+"正在汪汪跑");
    }
    public Dog(String name){
        super(name);
    }
}
class Duck extends Animal implements IRun,ISwim,IFly{
    public void run(){
        System.out.println(this.name+"正在嘎嘎跑");
    }
    public void swim(){
        System.out.println(this.name+"正在嘎嘎游泳");
    }
    public void fly(){
        System.out.println(this.name+"正在嘎嘎飞");
    }
    public Duck(String name){
        super(name);
    }
}